package com.ysg.widget.dialog;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.ysg.R;
import com.ysg.base.BaseDialog;

/**
 * 头像编辑
 */
public class AvatarEditDialog extends BaseDialog {
    public interface OnConfirmListener{
        void onConfirmClick();
    }
    private OnConfirmListener listener;
    public void setOnConfirmListener(OnConfirmListener listener){
        this.listener = listener;
    }

    public AvatarEditDialog(Context context) {
        super(context);
    }

    private ImageView ivClose;
    private TextView tvConfirm;

    @Override
    public int getLayoutId() {
        return R.layout.dialog_avatar_edit;
    }

    public void initView() {
        ivClose = findViewById(R.id.ivClose);
        tvConfirm = findViewById(R.id.tvConfirm);
    }


    @Override
    public void initData() {
    }

    @Override
    public void initListener() {
        tvConfirm.setOnClickListener((v)->{
            dismiss();
            if (listener != null){
                listener.onConfirmClick();
            }
        });
        ivClose.setOnClickListener((v)->{
            dismiss();
        });
    }


}
